package com.icehelper.hades.base.controller;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.util.Collections;
import java.util.List;

/**
 * Description: 
 * @Author: chenzhenglang
 * @Date: 2020/11/20 2:34 下午
*/
@lombok.Data
@NoArgsConstructor
@AllArgsConstructor
public class PageData<T>{

  private Long total;

  private List<T> items;

  public static <T> PageData<T> build(Long total, List<T> items) {
    return new PageData<T>(total, items);
  }

  public static <T> PageData<T> build() {
    return new PageData<T>(0L, Collections.emptyList());
  }
}
